package com.ssd4.uidesign.dao;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import org.hibernate.Query;
import org.hibernate.SessionFactory;

import com.ssd4.service.inter.UserAccountInter;
import com.ssd4.uidesign.service.BaseServiceInter;
import com.ssd4.uidesign.util.BaseDao;
import com.ssd4.uidesign.vo.UserAccount;

public class UserAccountDao implements UserAccountInter{
	private SessionFactory sessionFactory;
	
	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}
	//通过hql语句和变量赋值，获取数据库里的记录
	public List getResult(String hql, Object[] parameters) {
		Query query = sessionFactory.openSession().createQuery(hql);
		if(parameters != null && parameters.length > 0){
			for(int i=0;i<parameters.length;i++){
				//把hql语句中的?设置为parameters中的参数
				query.setParameter(i, parameters[i]);
			}
		}
		return query.list();
	}
	public void save(Object obj) {
		// TODO Auto-generated method stub
		
	}
	public void delete(Object obj) {
		// TODO Auto-generated method stub
		
	}
	public void update(Object obj) {
		// TODO Auto-generated method stub
		
	}
	public Object getObject(String hql, Object[] parameters) {
		// TODO Auto-generated method stub
		return null;
	}
	
	
	
}